package net.wofly.right.util;

/**
 * 功能类型
 * @author lign
 * @version 1.0
 * @created 30-十二月-2017 12:02:44
 */
public enum FuncType {
    接口(1, "接口"),
	路由(2, "路由"),
	菜单(3, "菜单");

    private Integer value;
    private String name;

    FuncType(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static boolean isValueCorrect(Integer value) {
        for (FuncType forEnum : values()) {
            if (forEnum.getValue().equals(value)) {
                return true;
            }
        }
        return false;
    }

    public static String getName(Integer value) {
        for (FuncType forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }
}